package com.jic.point.controller.feign;

import com.github.pagehelper.PageInfo;
import com.jic.common.base.vo.RestResult;
import com.jic.point.api.EarlyWarningApi;
import com.jic.point.rest.request.PublMemberLogsRequest;
import com.jic.point.rest.response.PublMemberLogs;
import com.jic.point.service.PublMemberLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName EarlyWarningFeign
 * TODO
 * @Description
 * @Author chenhongfeng
 * @Date 2020/11/28 16:12
 * @Version 1.0
 **/
@Api(tags = {"Feign-查询会员积分接口"})
@RequestMapping(value = "/api/point/publmember")
@RestController
public class EarlyWarningFeign implements EarlyWarningApi {

    @Autowired
    PublMemberLogService service;

    @PostMapping("/listPage")
    @ApiOperation(value = " 分页查询列表 ")
    @ResponseBody
    @Override
    public RestResult<PageInfo<PublMemberLogs>> listPage(PublMemberLogsRequest request) {
        PublMemberLogs param = new PublMemberLogs();
        BeanUtils.copyProperties(request, param);
        param.setDeleteFlag(0);
        return RestResult.success(service.listPage(param, request.getPageNum(),request.getPageSize()));
    }
}
